using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMoveState : PlayerGroundState
{
    public PlayerMoveState(Player _player, PlayerStateMachine _stateMachine, string _animBoolName) : base(_player, _stateMachine, _animBoolName)
    {

    }

    public override void Enter()
    {
        base.Enter();
        AudioManager.instance.PlaySFX(14, null);
    }

    public override void Exit()
    {
        base.Exit();
        AudioManager.instance.StopSFX(14);
    }

    public override void Update()
    {
        base.Update();
        // 移动
        player.SetVelocity(xInput * player.moveSpeed, rb.velocity.y);
        // x轴没有输入------或角色站在墙边时进入待机状态--限制墙体边缘不能移动-不是很必要的玩意
        if (xInput == 0)//|| player.IsWallDetected()
        {
            stateMachine.ChangeState(player.idleState);
        }
    }
}
